<div id="content">       

    <? if(is_array($response)){?>
    <div class="response">
        <span class="<?=$response["class"]?>"><?=$response["msg"]?></span>
    </div>
    <?}?>

    <div class="float_block_right">
        <a class="button" href="<?=site_url('admin/products/add')?>">ADD NEW PRODUCT</a>
        <a class="button" href="<?=site_url('admin/products/export')?>">EXPORT DATA</a>
    </div>

    <h1>Products</h1>


    <div class="live_search_msg"></div>
    <? foreach($list as $item){?>
        <div class="product_block search <?=($item['Approved_Products']!=1)?'unapproved':(($item['Active_Products']=='1')?'active':'inactive')?>">     
            <a href="<?=site_url('admin/products/preview/'.$item['id_Products'])?>" rel="view">
            <img src="<?=thumbnail(base_url().UPLOADS_FOLDER.PRODUCT_IMG_FOLDER.$item['Main_Image'])?>" />
            <span class="title">
                <?=$item['Name_Products']?>
            </span>
            </a>           
            

            <a href="<?=site_url('admin/products/edit/'.$item['id_Products'])?>" class="button">edit</a>
            <? if($item['Approved_Products']==1) { ?>
                <? if ($item['Active_Products'] == 1){?>
                <a href="<?=site_url('admin/products/deactivate/'.$item['id_Products'])?>" class="button">deactivate</a>
                <? } else { ?> 
                <a href="<?=site_url('admin/products/activate/'.$item['id_Products'])?>" class="button">activate</a>
                <? } ?>
            <? } else if(is_allowed(array(ROLE_ADMIN,ROLE_PUBLISHER))){ ?>
                <a href="<?=site_url('admin/products/approve/'.$item['id_Products'])?>" class="button">approve</a>
            <? } ?>
            <a href="<?=site_url('admin/products/remove/'.$item['id_Products'])?>" class="button">delete</a>

        </div>
    <? } ?>

</div>